
package results;

import objects.MobileStation;
import objects.Station;


/**
 * 
 *
 * @author Guillaume
 * @created June 7, 2004 
 */

public class ProbeEnergyConsumption extends ProbeEnergy {

	/** Property name monitored by the probe */
	private static final String PROPERTY_NAME = "ProbeEnergyConsumption";

	/** Probe description */
	private static final String PROBE_DESCRIPTION = "";
	

	/**
	 * @param whichLoopPeriod
	 * @param t
	 * @param propertyName
	 * @param probeName probe name
	 */
	public ProbeEnergyConsumption(MobileStation t,String probeName) {
		super(DEPL_LOOP, t, probeName);
	}

	/** 
	 * (non-Javadoc)
	 * @see Results.Probe#getValue()
	 */
	protected Object getValue() {
		MobileStation m = (MobileStation) _linkedStation;
		int state = m.getState();
		if(state == Station.ASLEEP){
		    return new Double(0.0);
		}else{
		    return new Double(m.getConsumption()[state]);
		}
	}

	/**
	 * Get the property Name
	 * @return property name
	 * @see Results.Probe#getPropertyName()
	 */
	public String getPropertyName() {
		return PROPERTY_NAME;
	}

	/**
	 * Get the descitption of the probe
	 * @return probe description
	 * @see Results.Probe#getProbeDescription()
	 */
	public String getProbeDescription() {
		return PROBE_DESCRIPTION;
	}

	public static void main(String[] args) {
	}
}
